'\" te
.\" Copyright 2015 Shruti V Sampat <shrutisampat@gmail.com>
.\" Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH UTMPD 8 "Feb 17, 2023"
.SH NAME
utmpd \- utmpx monitoring daemon
.SH SYNOPSIS
.nf
\fButmpd\fR [\fB-debug\fR]
.fi

.SH DESCRIPTION
The \fButmpd\fR daemon monitors the \fB/var/adm/utmpx\fR file. See
\fButmpx\fR(5) (and \fButmp\fR(5) for historical information).
.sp
.LP
\fButmpd\fR receives requests from \fBpututxline\fR(3C) by way of a named pipe.
It maintains a table of processes and uses \fBpoll\fR(2) on \fB/proc\fR files
to detect process termination. When \fButmpd\fR detects that a process has
terminated, it checks that the process has removed its \fButmpx\fR entry from
\fB/var/adm/utmpx\fR. If the process' \fButmpx\fR entry has not been removed,
\fButmpd\fR removes the entry. By periodically scanning the
\fB/var/adm/utmpx\fR file, \fButmpd\fR also monitors processes that are not in
its table.
.SH OPTIONS
.ne 2
.na
\fB\fB-debug\fR\fR
.ad
.sp .6
.RS 4n
Run in debug mode, leaving the process connected to the controlling terminal.
Write debugging information to standard output.
.RE

.SH EXIT STATUS
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.sp .6
.RS 4n
An error occurred.
.RE

.SH FILES
.ne 2
.na
\fB\fB/etc/default/utmpd\fR\fR
.ad
.sp .6
.RS 4n
You can set default values for the flags listed below. For example:
\fBSCAN_PERIOD=600\fR
.sp
The values for these flags should be greater than 0. If values read
from the file are found to be less than or equal to 0, or containing
invalid characters, the default values mentioned below are retained.
.sp
.ne 2
.na
\fB\fBSCAN_PERIOD\fR\fR
.ad
.sp .6
.RS 4n
The number of seconds that \fButmpd\fR sleeps between checks of \fB/proc\fR to
see if monitored processes are still alive. The default is 300.
.RE

.sp
.ne 2
.na
\fB\fBMAX_FDS\fR\fR
.ad
.sp .6
.RS 4n
The maximum number of processes that \fButmpd\fR attempts to monitor. The
default value is 4096.
.RE

.sp
.ne 2
.na
\fB\fBWTMPX_UPDATE_FREQ\fR\fR
.ad
.sp .6
.RS 4n
The number of seconds that \fButmpd\fR sleeps between read accesses of the
\fBwtmpx\fR file. The \fBwtmpx\fR file's last access time is used by
\fBinit\fR(8) on reboot to determine when the operating system became
unavailable. The default is 60.
.RE

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/utmpx\fR\fR
.ad
.sp .6
.RS 4n
File containing user and accounting information for commands such as
\fBwho\fR(1), \fBwrite\fR(1), and \fBlogin\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB/proc\fR\fR
.ad
.sp .6
.RS 4n
Directory containing files for processes whose \fButmpx\fR entries are being
monitored.
.RE

.SH SEE ALSO
.BR svcs (1),
.BR poll (2),
.BR pututxline (3C),
.BR proc (5),
.BR utmp (5),
.BR utmpx (5),
.BR attributes (7),
.BR smf (7),
.BR init (8),
.BR svcadm (8)
.SH NOTES
If the filesystem holding \fB/var/adm/wtmpx\fR is mounted with options which
inhibit or defer access time updates, an unknown amount of error will be
introduced into the \fButmp\fR \fBDOWN_TIME\fR record's timestamp in the event
of an uncontrolled shutdown (for example, a crash or loss of power).
Controlled shutdowns will update the modify time of \fB/var/adm/wtmpx\fR, which
will be used on the next boot to determine when the previous shutdown occurred,
regardless of access time deferral or inhibition.
.sp
.LP
The \fButmpd\fR service is managed by the service management facility,
\fBsmf\fR(7), under the service identifier:
.sp
.in +2
.nf
svc:/system/utmp:default
.fi
.in -2
.sp

.sp
.LP
Administrative actions on this service, such as enabling, disabling, or
requesting restart, can be performed using \fBsvcadm\fR(8). The service's
status can be queried using the \fBsvcs\fR(1) command.
